﻿{% extends "base.html" %}
{% block title %}{{participante.nome}}{% endblock %}

{% block content %}

<script language="JavaScript"><!--
function handler(e) {
    var key = (navigator.appName == "Netscape") ? e.which : e.keyCode;
    if ( key == 8 || key == 0 || key == 13 || key == 46 || (key > 47 && key < 58))
        return true;
    else {
        return false;
    }
}
//--></script>

    <form action="/editapalpites" method="post">
    <input type="hidden" name="key" value="{{participante.key}}" />
    
    {% for quadro in quadros %}
        <h2>{{quadro.0.grupo}}</h2>
        <table class="edicao">
            <colgroup style="width:  6%;"></colgroup>
            <colgroup style="width: 35%;"></colgroup>
            <colgroup style="width: 5%;"></colgroup>
            <colgroup style="width: 14%;"></colgroup>
            <colgroup style="width: 5%;"></colgroup>
            <colgroup style="width: 35%;"></colgroup>

            <thead>
                <tr>
                    <td>Jogo</td>
                    <td></td>
                    <td></td>
                    <td>Seu palpite</td>
                    <td></td>
                    <td></td>
                </tr>        
            </thead>
            
            <tbody>
                {% for linha in quadro %}
                <tr class="cor{{linha.cor_da_linha}}">
                    <td>{{linha.num_jogo}}</td>
                    <td class="right"> {{linha.nome_pais1}} </td>
                    <td class="bandeira"> <img src="/imagens/{{linha.pais1}}.gif"> </td>
                    <td>
                        <input class="placar" id="j{{linha.num_jogo}}_sc1" type=text name="j{{linha.num_jogo}}_sc1" size=3 maxlength=2 value='{{linha.palpite1}}' onKeyPress="return handler(event)"></input>
                        X
                        <input class="placar" id="j{{linha.num_jogo}}_sc2" type=text name="j{{linha.num_jogo}}_sc2" size=3 maxlength=2 value='{{linha.palpite2}}' onKeyPress="return handler(event)"></input>
                    </td>
                    <td class="bandeira"> <img src="/imagens/{{linha.pais2}}.gif"> </td>
                    <td class="left"> {{linha.nome_pais2}} </td>
                </tr>
                {% endfor %}
                                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td class="right">
                        <input class="submit" type="submit" value="Salve">
                    </td>
                </tr>
            </tbody>
        </table>
    {% endfor %}
    
    <p><input class="submit" type="submit" value="Salve seus palpites"></p>
    </form>

{% endblock %}
